﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace AIRO.Devices.Ccd
{
    [Guid("C227B849-17DB-4f44-9210-ECEC2A8276F7")] 
    public enum CcdState : int
    {
        Idle,        
        Running,
        Error        
    }

    [Guid("1D3EECFD-E105-4e64-A80C-8DD8E2698C2E")]
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("AIRO.Devices.Ccd.StateChangedEventArgs")]
    public class StateChangedEventArgs : EventArgs
        {

            private CcdState _newState;
            
            public StateChangedEventArgs(CcdState newState)
            {
                this._newState = newState;
            }

            public CcdState State
            {
                get
                {
                    return _newState;
                }
            }
        }

    [Guid("B44A4F6B-C353-42b5-A9C3-ED3DC89C931E")]
    [InterfaceType(ComInterfaceType.InterfaceIsDual)]
    public interface ICcd
    {
        [DispId(1)]
        CcdState State { get; }
        [DispId(2)]
        int NumberOfSpectra { get; set; }
        [DispId(3)]
        bool StartMeasure();
        [DispId(4)]
        bool Measure();
        [DispId(5)]
        double[,] GetFrame(int frameNumber);
        [DispId(6)]
        event EventHandler<StateChangedEventArgs> StateChangedEvent;
        [DispId(7)]
        event EventHandler<EventArgs> MeasurementCompleteEvent;
    }
}
